/**
 * @file stopwatch.h
 *
 */
#ifndef STOPWATCH_H
#define STOPWATCH_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
*      INCLUDES
*********************/

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_STOPWATCH != 0

/*********************
*      DEFINES
*********************/
#define STOPWATCH_LABEL_NON_MS_WIDTH    (26) // for font 40
#define STOPWATCH_LABEL_MS_WIDTH        (20) // for font 30
#define STOPWATCH_LABEL_COLON_WIDTH     (9)
#define STOPWATCH_LABEL_SPACE_WIDTH     (6)

/**********************
*      TYPEDEFS
**********************/
typedef struct
{
    lv_img_ext_t oldext;
    lv_obj_t     *label_title;
    lv_obj_t     *label_hour_1;
    lv_obj_t     *label_hour_2;
    lv_obj_t     *label_colon_1;
    lv_obj_t     *label_min_1;
    lv_obj_t     *label_min_2;
    lv_obj_t     *label_colon_2;
    lv_obj_t     *label_sec_1;
    lv_obj_t     *label_sec_2;
    lv_obj_t     *label_ms_1;
    lv_obj_t     *label_ms_2;
    lv_obj_t     *img_btn_start_pause;
    lv_obj_t     *img_btn_reset;
} lv_stopwatch_ext_t;

/**********************
* GLOBAL PROTOTYPES
**********************/

/**
 * Create a stopwatch application
 */
lv_obj_t *stopwatch_create(lv_obj_t *par);
void stopwatch_create_event_cb(lv_obj_t * btn, lv_event_t e);

/**********************
*      MACROS
**********************/

#endif /*USE_LV_WATCH_STOPWATCH*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*STOPWATCH_H*/
